<template>
	<view style="padding-bottom: 100rpx;">
		<u-navbar v-if="!$isWeixin()" :customBack="backToList" :title="title" :titleBold="true" :is-fixed="true" :background="{backgroundColor: '#fff'}"></u-navbar>
		
		<u-tabs :list="tabList" :current="tabIndex" @change="(index) => tabIndex = index"></u-tabs>
		
		<view class="" v-if="tabIndex == 0">
			<relations :list="This_Dealer_RelationList"></relations>
		</view>
		
		<view class="" v-if="tabIndex == 1">
			<u-cell-item :arrow="false" title="一级门店名称" :value="First_Dealer_BaseInfo.Name"></u-cell-item>
			<u-cell-item :arrow="false" title="二级门店名称" :value="Double_Dealer_BaseInfo.Name"></u-cell-item>
			<store-information :data="Door_Dealer_BaseInfo"></store-information>
		</view>
		
		<view class="" v-if="tabIndex == 2">
			<store-photo :list="DoorPhotoList"></store-photo>
			<u-cell-item title="申请备注" :arrow="false" :value="DealerAuditInfo.ApplayRemark"></u-cell-item>
		</view>
		
		<view class="" v-if="tabIndex == 3">
			<u-cell-group>
				<u-cell-item title="门店等级" :arrow="false">
					<u-radio-group v-model="DoorPhotoAuditInfo.Grade">
						<view class="">
							<u-radio :disabled="true" :name="1">A</u-radio>
							<u-radio :disabled="true" :name="2">B</u-radio>
							<u-radio :disabled="true" :name="3">C</u-radio>
						</view>
					</u-radio-group>
				</u-cell-item>
				<u-cell-item title="模块化" :arrow="false">
					<u-radio-group v-model="DoorPhotoAuditInfo.Module">
						<view class="">
							<u-radio :disabled="true" :name="1">模块化</u-radio>
							<u-radio :disabled="true" :name="2">非模块化</u-radio>
						</view>
					</u-radio-group>
				</u-cell-item>
				<u-cell-item title="门头化" :arrow="false">
					<u-radio-group v-model="DoorPhotoAuditInfo.IsDoor">
						<view class="">
							<u-radio :disabled="true" :name="1">门头化</u-radio>
							<u-radio :disabled="true" :name="0">非门头化</u-radio>
						</view>
					</u-radio-group>
				</u-cell-item>
				<u-cell-item title="样机类型" :arrow="false">
					<u-checkbox-group>
						<view>
							<u-checkbox :disabled="true" :value="DoorPhotoAuditInfo.IsPrototype == 1 || DoorPhotoAuditInfo.IsPrototype == 3" :name="1">空壳样机</u-checkbox>
							<u-checkbox :disabled="true" :value="DoorPhotoAuditInfo.IsPrototype == 2 || DoorPhotoAuditInfo.IsPrototype == 3" :name="2">实体样机</u-checkbox>
						</view>
					</u-checkbox-group>
				</u-cell-item>
				<u-cell-item title="精选门店" :arrow="false">
					<u-radio-group v-model="DoorPhotoAuditInfo.IsGoodDoor">
						<view class="">
							<u-radio :disabled="true" :name="1">是</u-radio>
							<u-radio :disabled="true" :name="0">否</u-radio>
						</view>
					</u-radio-group>
				</u-cell-item>
				<u-cell-item title="审核备注" :arrow="false">
					<u-input :disabled="true" type="textarea" inputAlign="right" :customStyle="{color: '#909399'}"></u-input>
				</u-cell-item>
				
				<review-flow :data="AuditForList"></review-flow>
			</u-cell-group>
		</view>
		
		<view class="btn-group-fixed">
			<u-button type="warning" @click="backToList">返回列表</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '门店照片详情',
				InfoId: null,
				tabList: [
					{name: '销售业务关系'},
					{name: '基本信息'},
					{name: '门店照片'},
					{name: '处理意见'},
				],
				tabIndex: 0,
				
				
				DataBaseInfo: {},
				DealerAuditInfo: {},
				DoorPhotoAuditInfo: {},
				DoorPhotoList: [],
				Door_Dealer_BaseInfo: {},
				Double_Dealer_BaseInfo: {},
				First_Dealer_BaseInfo: {},
				This_Dealer_RelationList: [],
				AuditForList: []
			};
		},
		
		onLoad(options) {
			if(options.InfoId) {
				this.InfoId = options.InfoId
			}
			this.getData();
			
			if(this.$isWeixin()) {
				this.$setTitle(this.title);
			}
		},
		
		methods: {
			backToList() {
				uni.navigateBack()
			},
			
			getData() {
				
				this.$u.api.getPhotoInformationReviewDetail({
					InfoId: this.InfoId
				}).then(res => {
					console.log(res)
					const { ResultCode, 
					DataBaseInfo, DealerAuditInfo, DoorPhotoAuditInfo, AuditForList,
					DoorPhotoList, Door_Dealer_BaseInfo, Double_Dealer_BaseInfo,
					First_Dealer_BaseInfo, This_Dealer_RelationList } = res;
					
					if(ResultCode === 1) {
						this.DataBaseInfo = DataBaseInfo;
						this.DealerAuditInfo = DealerAuditInfo;
						this.DoorPhotoAuditInfo = DoorPhotoAuditInfo;
						this.DoorPhotoList = DoorPhotoList;
						this.Door_Dealer_BaseInfo = Door_Dealer_BaseInfo;
						this.Double_Dealer_BaseInfo = Double_Dealer_BaseInfo;
						this.First_Dealer_BaseInfo = First_Dealer_BaseInfo;
						this.This_Dealer_RelationList = This_Dealer_RelationList;
						this.AuditForList = AuditForList;
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	

</style>
